package com.wao.file.service;

import com.wao.file.domain.BatchStatus;
import com.wao.file.domain.FileInfo;
import com.wao.file.domain.FileKey;
import com.wao.file.domain.FileListing;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

public interface FileStorage {

    public String uploadToken(String bucket, String key, long expires, Map<String, Object> policy);

    public FileKey upload(InputStream stream, String key, String token, Map<String, Object> params, String mime) throws IOException;

    public FileKey recordUpload(InputStream stream, String key, String token, Map<String, Object> params, String mime) throws IOException;

    public String privateDownload(String fileName, long expires) throws IOException;

    public FileInfo stat(String bucket, String fileKey) throws IOException;

    public void copy(String fromBucket, String fromFileKey, String toBucket, String toFileKey, boolean force) throws IOException;

    public void move(String fromBucket, String fromFileKey, String toBucket, String toFileKey, boolean force) throws IOException;

    public void delete(String bucket, String key) throws IOException;

    public FileListing listFiles(String bucket, String prefix, String marker, int limit, String delimiter) throws IOException;

    public List<BatchStatus> batchDelete(String bucket, String... keys) throws IOException;

}
